package com.study.lock.demo;

import com.study.common.entity.Model;
import org.openjdk.jol.info.ClassLayout;

public class LockTest {

    public static void main(String[] args) {
        Model m = new Model();
        System.out.println(ClassLayout.parseInstance(m).toPrintable());

        synchronized (m) {
            System.out.println(ClassLayout.parseInstance(m).toPrintable());
            m.hashCode();
            try {
                Thread.sleep(1000);
            } catch (Exception e) {

            }

            System.out.println(ClassLayout.parseInstance(m).toPrintable());
        }

        System.out.println(ClassLayout.parseInstance(m).toPrintable());
    }
}
